package com.yinNuo.collectWool.mobileApi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yinNuo.collectWool.mobileApi.dao.LoginOperationLogDao;
import com.yinNuo.collectWool.mobileApi.entity.LoginOperationLog;
import com.yinNuo.collectWool.mobileApi.service.LoginOperationLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 登录操作日志表(LoginOperationLog)表服务实现类
 *
 * @author makejava
 * @since 2021-12-12 10:54:12
 */
@Service("loginOperationLogService")
public class LoginOperationLogServiceImpl extends ServiceImpl<LoginOperationLogDao,LoginOperationLog> implements LoginOperationLogService {
    @Resource
    private LoginOperationLogDao loginOperationLogDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public LoginOperationLog queryById(Integer id) {
        return this.loginOperationLogDao.queryById(id);
    }

    /**
     * 新增数据
     *
     * @param loginOperationLog 实例对象
     * @return 实例对象
     */
    @Override
    public LoginOperationLog insert(LoginOperationLog loginOperationLog) {
        this.loginOperationLogDao.insert(loginOperationLog);
        return loginOperationLog;
    }

    /**
     * 修改数据
     *
     * @param loginOperationLog 实例对象
     * @return 实例对象
     */
    @Override
    public LoginOperationLog update(LoginOperationLog loginOperationLog) {
        this.loginOperationLogDao.update(loginOperationLog);
        return this.queryById(loginOperationLog.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.loginOperationLogDao.deleteById(id) > 0;
    }
}
